Let's take a look at some of our options to enhance our development workflow and bam.
The first thing that comes to mind is auto completion get into insert mode and press control X then
control OK to let the general dictionary suggestions pop up.
There are some plugins to enhance the experience but let's work with the basics
right off the bat.
It won't give us anything.
It tells us that the beach scenary is empty because dictionaries aren't loaded by default and vim.
But it's definitely there.
We just have to load it
now by pressing control X then control OK.
Again we get a list of dictionary words really not that useful as we are programming in PH BE press
control and control be to scroll through the results.
OK press escape to get the context the word syntax completion we will have to press control X then control
press control then or control B to scroll and then just keep writing
it isn't necessary to load that each on every project context where syntax compilation the list of complete
items will be recorded in memory.
So if you were to type in one again you will just have to press control and to let a suggestion pop
up the other completion feature is fairly rudimentary.
You can look up plugins Doyle about to provide the other completion feature targeting specific programming
languages on the Internet.
There are also plug ins to other cause curly braces for example but I'll teach you that how to customize
VM to obtain the same result by modifying the VM RC file.
You can map every command globally with the map command or specifically for a normal insert and visual
lock my word will issue the mappings in the current document to make the changes permanent.
You can always add it up to be c a file and add these commands and without the initial call and of course
for example we can remet d o and Capitol o keys to insert a new line without dropping You mean sort
them out.
I always prefer this so that I could avoid pressing enter to add some lines
now press 0 multiple times Breske capital.
Oh multiple times again.
It never drops into interrupt mode with the map command.
We first define the character we want to modify then present a list of keystrokes we want that character
to perform map is global it will map the common to for Insearch normal and visual lock mode to create
mappings specifically for each model.
We will use map and map and VM map respectively.
Let's create a mapping to the metrically close curly braces
OK let's move on to code folding.
We first have to select a chunk of text in visual mode.
Then hate the F to create a fold.
To open the fold type Z.
You can also press l when the cursor is placed on the line then we see we can fold the selected code
again.
Let's do it again for another range of lines.
So Lesch to search for the end of the head tag.
This election is to be scaped so type backslash slash head.
Then the dollar sign to get to the end of the line.
The F to fold it.
You can also hit Z A to alternate between closing and opening the fold to open o folds and a file type
Z.
Copied all our
close them all z copy the whole album.
This is called Manual folding.
If we exit and open the file again the folding will be lost to make the manual folding persist and we'll
have to save the document to save falls.
You'll have to type in Colon.
OK.
Let's exit.
Let's open the file again.
We can load the view again with Colonne load Wii-U
one to make that Automattic for every file you create falls for these two lines you need to be a massive
pile.
Now every field manual is set on any file will always be remembered by an
we can also automate the folding by inundation by riding in the.
That would be Marsi file the related options.
I would type them in the comment line.
This might come in useful depending on your preferences just like vi is for code folding.
We can use sessions in a VM to save anything about the layout at large.
We can now see the lay out with the M.K. session command
then open the session file again with the source command.
All right.
You can also directly open the vim's session with the S flag.
You can modify the contents of the session file sessions.
Keep track of a lot of variables within them.
So that's it.
This is the end of the course.
We started out from moving around in normal mode up to customizing VM to the point where there's not
much of a difference when compared to our completely functional ID in the next video I will give you
some more references to check out.